package com.hctforgreen.greenservice.model;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * 
 * @author denghb
 * 
 */
public class AttrEntity extends BaseEntity {

	private static final long serialVersionUID = 7084740916307013863L;
	/**
	 * 20160910--390694添加注释
	 * 资料大类别的id
	 */
	public String id = "";
	public String name = "";

	public boolean isSelected = false;

	public AttrEntity(String id, String name) {
		this.id = id;
		this.name = name;
	}

	public AttrEntity() {
	}

	public static AttrEntity parse(JSONObject jsonObject) throws JSONException {

		AttrEntity attrEntity = new AttrEntity();

		if (jsonObject == null) {
			return attrEntity;
		}
		if (jsonObject.has("id")) {
			attrEntity.id = jsonObject.getString("id");
		}
		if (jsonObject.has("name")) {
			attrEntity.name = jsonObject.getString("name");
		}
		return attrEntity;
	}

}
